package com.hankol.community.utils

import com.baselibrary.BuildConfig
import com.baselibrary.Constants
import com.baselibrary.bean.SelectSendFriend4Bean
import com.baselibrary.router.ActivityRouter
import com.hankol.community.api.CommunityConstant
import com.hankol.community.bean.ShowShare2Bean

/**
 *@author:hanke
 *2022/5/19
 *desc:
 */
object  TransferUtil {
    fun showShare2Bean2SelectSendFriend2Bean(fromeBean: ShowShare2Bean): SelectSendFriend4Bean {
        var path = ""
        //动态类型  1：图片 2：视频 3话题、4文章、 5直播、6 百科  7 讲坛的视频详情
        when (fromeBean.showType) {
            //图片详情
            Constants.DYNAMIC_TYPE_IMG -> path = "${ActivityRouter.ACTIVITY.IMAGE_DETAIL}?id=${fromeBean.id}"
            //文章详情
            Constants.DYNAMIC_TYPE_ARTICLE -> path = "${ActivityRouter.COMMUNITY.ARTICLE_DETAIL}?aid=${fromeBean.id}"
            //讲坛的视频详情
            Constants.DYNAMIC_TYPE_BEMA_VIDEO_DETAIL -> path = "${ActivityRouter.COMMUNITY.COMMUNITY_PULPIT_VIDEO}?${CommunityConstant.PUL_COURSE_ID}=${fromeBean.id}&${CommunityConstant.PULPIT_ID}=${fromeBean.pulpitId}"
            //话题详情
            Constants.DYNAMIC_TYPE_TOPIC -> path = "${ActivityRouter.COMMUNITY.COMMUNITY_TOPIC_DETAIL}?tid=${fromeBean.id}"

        }
        return SelectSendFriend4Bean().apply {
            fromeBean.let {
                id = it.id
                //动态类型  1：图片 2：视频 3话题、4文章、 5直播、6 百科  7 讲坛的视频详情
                showType = it.showType
                cover = it.cover
                images = listOf(it.cover)
                title = it.name
                content = it.content
                icon = it.headUrl
                name = it.name
                isFans = it.isFans
                route = "${if (BuildConfig.DEBUG) "thd7pq:/" else "r3fuww:/"}${path}"
            }
        }
    }
}